from flask import session, render_template
from functools import wraps

def permission(roles):
	def decorator(func):
		@wraps(func)
		def wrapper(*args, **kw):
			if session.get('role', '') not in roles:
				return render_template('403.html'), 403
			return func(*args, **kw)
		return wrapper
	return decorator				
